#20 ✓resolved
Rick DeNatale

RiCal::PropertyValue::Period returns nil ruby_value

Reported by Rick DeNatale | August 6th, 2009 @ 01:41 PM

This is a bug.

Failing spec example:

describe "freebusy problem" do

before(:each) do
  cal = RiCal.parse_string(<<ENDCAL)

BEGIN:VCALENDAR METHOD:PUBLISH VERSION:2.0 PRODID:Zimbra-Calendar-Provider BEGIN:VFREEBUSY ORGANIZER:mailto:bj-wagoner@wiu.edu DTSTAMP:20090805T200417Z DTSTART:20090705T200417Z DTEND:20091006T200417Z URL:https://zimbra9.wiu.edu/service/home/bjw101/calendar.ifb?null FREEBUSY;FBTYPE=BUSY:20090705T200417Z/20090707T050000Z FREEBUSY;FBTYPE=BUSY-TENTATIVE:20090711T050000Z/20090712T050000Z END:VFREEBUSY END:VCALENDAR ENDCAL

@free_busy = cal.first.freebusys.first

it "should have two periods" do
  @free_busy.freebusy.map {|fb| fb.to_s}.should == [

---------- Forwarded message ---------- From: Matt Mencel MR-Mencel@wiu.edu
Date: Wed, Aug 5, 2009 at 5:55 PM
Subject: Trouble Using ri_cal to Parse FREEBUSY File
To: rick.denatale@gmail.com
Cc: Brad J Wagoner BJ-Wagoner@wiu.edu

Hi Rick,

I'm hoping you have time for a quick question about your ri_cal gem.

We're trying to parse a .IFB file to grab the freebusy events out of
it, but when we get to the point where it should be pulling the Period
instances out....all we get back are NilClass objects.  91 one of them
in our test file....and there are 91 periods.  So it seems to be
getting the Periods, but not grabbing data in each Period.  Here's a
small code sample...

    File.open("public/calendar.ifb", "r") do |file|
      @components = RiCal.parse(file)

    @freebusys = @components[0].freebusys()
    @periods = @freebusys[0].freebusy()

At this point if we do....

@periods.each do |p|    #do something with p

The value of p is always nil.

Any ideas?  I attached the IFB file we are testing with.  Maybe there
is a problem with it?

Matt Mencel
Western Illinois University

-- Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences

Shared Ticket Bins

People watching this ticket